﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataTransferObject
{
    /*
     * chứa thông tin 1 khối thời gian trống
     * Tham khảo trong file báo cáo đồ án 1
     */
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    public class FreeTimeBlock
    {
        #region Attributes

        /// <summary>
        /// 
        /// </summary>
        private String ID;
        /// <summary>
        /// 
        /// </summary>
        private DateTime startDateTime;
        /// <summary>
        /// 
        /// </summary>
        private DateTime endDateTime;

        #endregion

        #region Essential Methods 

        /// <summary>
        /// Initializes a new instance of the <see cref="FreeTimeBlock"/> class.
        /// </summary>
        public FreeTimeBlock()
        { 

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="FreeTimeBlock"/> class.
        /// </summary>
        /// <param name="i">The i.</param>
        /// <param name="s">The s.</param>
        /// <param name="e">The e.</param>
        public FreeTimeBlock(String i, DateTime s, DateTime e)
        {
            ID = i;
            startDateTime = s;
            endDateTime = e;
        }

        public FreeTimeBlock(DateTime s, DateTime e)
        {
            startDateTime = s;
            endDateTime = e;
        }

        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return "id = " + this.ID + " | " +
                "start = " + this.startDateTime + " | " +
                "end = " + this.endDateTime + " | ";
        }

        /// <summary>
        /// Gets the time span.
        /// </summary>
        /// <returns></returns>
        public TimeSpan getTimeSpan()
        {
            return this.EndDateTime.Subtract(this.StartDateTime);
        }

        #endregion

        #region Properties

        public String ID_
        {
            get { return this.ID; }
            set { this.ID = value; }
        }

        public DateTime StartDateTime
        {
            get { return startDateTime; }
            set { startDateTime = value; }
        }

        public DateTime EndDateTime
        {
            get { return endDateTime; }
            set { endDateTime = value; }
        }
        #endregion

        #region bổ sung
        /* @LUÂN
         * CÁC BẠN CÓ THỂ:
         * 1. COMMENT VỀ NHỮNG BỔ SUNG GÓP Ý
         * 2. VIẾT CODE ĐỀ XUẤT TRONG REGION NÀY
         * 
        */


        #endregion

    }
}
